<?php

require_once('inc.db.php');

/*
*/


$q=$_GET['part'];

$result = mysql_query("select * from au_suburb_geo where Locality like '%$q%' or Pcode like '%$q%' or State1 like '%$q%' order by Pcode LIMIT 25");
while ($row = mysql_fetch_assoc($result)) {
   		$colors[]=$row['Locality']." ".$row['State1'].",".$row['Pcode'];
}
mysql_free_result($result);
mysql_close($link);

// check the parameter
if(isset($_GET['part']) and $_GET['part'] != '')
{
	$results = array();
	foreach($colors as $color){
		$results[] = $color;
	}
	echo json_encode($results);
}